<!DOCTYPE html>
<html lang="ch">
<head>
    <title></title>
    <script type="text/javascript" src="../js/vue.js"></script>
</head>
<body>
    <!-- 总结：数据代理
        通过一个对象代理对另一个对象中的属性进行操作,读写
    -->
    
    <script type="text/javascript">
        let obj = {
            x:200
        }
        let obj2 = {
            y:300
        }

        Object.defineProperty(obj2,'newx',{
            get(){
                return obj.x
            },
            set(value){
                obj.x = value
            }
        })
    </script>
</body>
</html>